#include <Arduino.h>
#include <stdint.h>
#include <Wire.h>
#include <Wifi.h>
#include "lvgl.h"

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"

#include "Port/Port.h"
#include "Devices/Devices.h"

void setup()
{
	Serial.begin(115200);
	Serial.println("");
	Serial.print(VERSION_FIRMWARE_NAME);
	Serial.print("System: " VERSION_SYSTEM_NAME);
	Serial.print("Hardware Version: " VERSION_HARDWARE);
	Serial.print("Software Version: " VERSION_SOFTWARE);
	Serial.print("Author: " VERSION_AUTHOR_NAME);
	Serial.println("\n");

	Power_Init();
	SD_Init();

	lv_port_disp_init();
	lv_port_fs_init();

	// 页面创建
	// lv_obj_t *Scr1 = lv_scr_act(); // 主页
	// lv_obj_clear_flag(Scr1, LV_OBJ_FLAG_SCROLLABLE);
	// lv_obj_set_style_bg_color(Scr1, lv_color_hex(0x123456), LV_PART_MAIN);

	lv_obj_t *btn1 = lv_btn_create(lv_scr_act());
	lv_obj_center(btn1);
	lv_obj_set_size(btn1, 200, 120);
	lv_obj_t *text1 = lv_label_create(btn1);
	lv_obj_center(text1);
	lv_obj_set_style_text_color(text1, lv_color_hex(0xffffff), LV_PART_MAIN);
	lv_label_set_text(text1, "Hello");
}

void loop()
{
	lv_task_handler();
	delay(5);
}